<?
	require_once('init.php');
	require_once('dataModel.php');
	
	$_SESSION["MenuID"]='';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$lng_characset;?>" />
	<meta name="keywords" content="GreenCity,Shoes,鞋,男鞋,女鞋,外销" />
	<meta name="description" content="GreenCity" />
	<meta name="copyright" content="Copyright (c) 2011 www.GreenCity.com All Rights Reserved." />
	<meta name="publisher" content="Copyright (c) 2010 www.GreenCity.com All Rights Reserved." />
	<meta name="author" content="GreenCity Team" />
	
	<TITLE><?=$AllPageTitle;?></TITLE> 

	<link href="css/main.css" rel="stylesheet" type="text/css" />
	<!--link href="css/Buttonstyle.css" rel="stylesheet" type="text/css" /-->
	<link href="css/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />
	<link href="css/register.css" rel="stylesheet" type="text/css" />
    
    <? include("alljs.php"); ?>
    
	<script>
		function changimages(){   
			vlen=document.getElementById("chleng").value ;   
			if (vlen==4) {
				document.getElementById("chleng").value=6;
			} else
	            {
				document.getElementById("chleng").value=4;
			}
	      	vlen=document.getElementById("chleng").value ; 
	      	imgobject=document.getElementById("verifyimge1"); 
			
			imgobject.src="CaptchaSecurityImages.php?width=100&height=40&characters="+vlen;
		 }		

		function registinfo()  //注册
		{
			value=$("#txtName").attr("value");
			if (value=="") 
			{
				hiAlert('<?=$strwriteuserid;?>', '<?=$strclueinfo;?>');
				$("#txtName").focus();
				return false;
			}	
			else
			{
			    if (value.length<4)
			    {
					hiAlert('<?=$struseridis4;?>', '<?=$strclueinfo;?>');
					$("#txtName").focus();
					return false;
			    }
			}
			
			value=$("#txtPWD").attr("value");
			if (value=="") 
			{
				hiAlert('<?=$strwritepwd;?>', '<?=$strclueinfo;?>');
				$("#txtPWD").focus();
				return false;
			}	
			else
			{
			    if (value.length<6)
			    {
					hiAlert('<?=$strpwdis6;?>', '<?=$strclueinfo;?>');
					$("#txtPWD").focus();
					return false;
			    }
			}

	       	if( $("#txtPWD").attr("value")==$("#txtagainPWD").attr("value"))
	       	{
	        }	
	       	else
			{
				parent.hiAlert("<?=$strpwdw;?>", '<?=$strclueinfo;?>');
				$("#txtPWD").focus();
				return false;
	        }

			value = $("#txtemail").attr("value");
	       	if( value=="")
	       	{
				parent.hiAlert("<?=$strwriteemail;?>", '<?=$strclueinfo;?>');
				$("#txtemail").focus();
				return false;
	        }
	        else 
	        {
				var EmailStr = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
			   	if(!EmailStr.test(value))
			   	{
	           		parent.hiAlert('<?=$stremailw;?>', '<?=$strclueinfo;?>');
				  	return false;
	            }
	        }

			var strSQL = "";                      
			strSQL+= "userName=";
			strSQL+=$("#txtName").attr("value");
			strSQL+="&userPWD=";
			strSQL+=$("#txtPWD").attr("value");         
			strSQL+="&email=";
			strSQL+=$("#txtemail").attr("value");
			strSQL+="&Type=registinfo";
		   
//		   alert (strSQL);
		   	
			$.post("varifyData.php",strSQL,function(msg)
			{
			   	
//			   	alert (msg);
			   	
			   	if (msg==2)   
			   	{	
			   		hiAlert('<?=$struserided;?>', '<?=$strclueinfo;?>');
			   	  	$("#txtName").focus();
			   		return false;
			   	}  
			   	  
			   	if (msg==1)   
			   	{	
					location="body2.php";
			   	}   
			})   		
		}

		function logininfo()
		{
			value=$("#txtuserName").attr("value");
			if (value=="") {
				hiAlert('<?=$strwriteuserid;?>', '<?=$strclueinfo;?>');
				$("#txtuserName").focus();
				return false;
			}	
			
			value=$("#txtvarify").attr("value");
			if (value=="") {
				hiAlert('<?=$strwritevarify;?>', '<?=$strclueinfo;?>');
				$("#txtvarify").focus();
				return false;
			}	
			
		   var strSQL = "";                      
		   strSQL+= "userName=";
		   strSQL+=$("#txtuserName").attr("value");
		   strSQL+="&userPWD=";
		   strSQL+=$("#txtuserPWD").attr("value");         
		   strSQL+="&varifyID=";
		   strSQL+=$("#txtvarify").attr("value");
		   strSQL+="&Type=LoginInfo";
		   
//		   alert (strSQL);
		   	
		   $.post("varifyData.php",strSQL,function(msg)
		   {
		   	
//		   	alert (msg);
		   	
		   	if (msg==-1)
		   	  {	hiAlert('<?=$strvarifyw;?>', '<?=$strclueinfo;?>');
		   	  	$("#txtvarify").focus();
		   	  	return false;
		   	  }
		   	  
		   	if (msg==2)   
		   	  {	hiAlert('<?=struseridw;?>', '<?=$strclueinfo;?>');
		   	  	$("#txtuserName").focus();
		   	  	return false;
		   	  }  
		   	 
//		   	alert (msg);
		   	  
		   	if (msg==1)   
		   	  {	
		   	  	location="body2.php";
		   	  }   
		   })        				
		}		
	</script>
	 
</head>

	<body>
		<?
		include("header.php"); 
		?>

		<div id="body2_h01" ></div>
		
		<div class="login_div">
			<div class="login-a01">   <!--注册-->
				<div class="login-a02"></div>   <!--注册头-->
				
				<!--放置一隐藏控件，用于存储存校验码长度-->
				<input type="hidden" name=="chleng" id="chleng" value="4">
		
				<div class="login-a03">   <!--登陆体-->
					<!--div class="login_x01">
						<div class="login_x02"><b><?=$struserregist;?></b></div>
					</div-->

					<div class="login-a04" style="margin-top:30px;"><b><?=$struserid;?>:</b></div>   <!--账号-->
					<div class="login-a05" style="margin-top:30px;"><input type="text" id="txtName" class="textboxclas"></div>
					
					<div class="login-a04" style="margin-top:10px;"><b><?=$struserpwd;?>:</b></div>   <!--密码-->
					<div class="login-a05" style="margin-top:10px;"><input type="password" id="txtPWD" class="textboxclas"></div>
					
					<div class="login-a04" style="margin-top:10px;"><b><?=$strtxtagainpwd;?>:</b></div>   
					<div class="login-a05" style="margin-top:10px;"><input type="password" id="txtagainPWD" class="textboxclas"></div>

					<div class="login-a04" style="margin-top:10px;"><b><?=$stremail;?>:</b></div>  
					<div class="login-a05" style="margin-top:10px;"><input type="text" id="txtemail" class="textboxclas"></div>

					<div class="login-a04" style="width:520px;margin-top:20px;text-align:center;">    <!--注册按钮-->
					    <input type="image" name="button_regist" value="button_regist" src="images/regist_btn.gif" onclick="javascript:registinfo();" >
					</div>  
					
				</div>
	
			</div>	

			<div class="login-a11">   <!--登陆-->
				<div class="login-a12"></div>   <!--登陆头-->
		
				<div class="login-a13">   <!--登陆体-->
					<!--div class="login_x01" style="width: 346px;">
						<div class="login_x02"  style="width: 346px;"><b><?=$struserlogin;?></b></div>
					</div-->

					<div style="width:340px;height:30px;margin-top:30px;margin-left:20px;text-align:left;color:black;border:0px solid red;"><?=$strlogindetail;?></div> 

					<div class="login-a14" style="margin-top:20px;"><b><?=$struserid;?>:</b></div>   <!--账号-->
					<div class="login-a15" style="margin-top:20px;"><input type="text" id="txtuserName" class="textboxclas1"></div>
					
					<div class="login-a14" style="margin-top:20px;"><b><?=$struserpwd;?>:</b></div>   <!--密码-->
					<div class="login-a15" style="margin-top:20px;">
						<input type="password" id="txtuserPWD" class="textboxclas1">
					    <div><a href="forgetpassword.php"><?=$strforgetpassword;?></a></div>

					</div>
					
					<div class="login-a14" style="margin-top:20px;"><b><?=$strvarify;?>:</b></div>   <!--密码-->
					<div class="login-a15" style="margin-top:20px;">
						<input type="text" id="txtvarify" class="textboxclas1"/>
						<img id="verifyimge1" src="CaptchaSecurityImages.php?width=100&height=40&characters=4"  border="0" 
             			onclick="changimages();" alt="<?=$strchangimages;?>"  Title="<?=$strchangimages;?>" />
					</div>

					<div class="login-a14" style="width:390px;margin-top:20px;text-align:center;">    <!--登陆按钮-->
					    <input type="image" name="button_login" value="button_login" src="images/login_btn.gif" onclick="javascript:logininfo();" >
					</div>  
				
				</div>
	
			</div>	
		</div> 

		<div id="body2_h02" ></div>
		
		<?
		include("footer.php"); 
		?>
	</body>		
</html>
